{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "import pandas as pd"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "fPath = './datas/餐饮人大学高级推广员名单0325.xls'"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [],
   "source": [
    "data = pd.read_excel(fPath)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>大区</th>\n",
       "      <th>负责人</th>\n",
       "      <th>高级推广员</th>\n",
       "      <th>电话</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1</td>\n",
       "      <td>李庆</td>\n",
       "      <td>杨正伟</td>\n",
       "      <td>13752875696</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>1</td>\n",
       "      <td>李庆</td>\n",
       "      <td>杨洋</td>\n",
       "      <td>18881930731</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>1</td>\n",
       "      <td>李庆</td>\n",
       "      <td>柏欣艳</td>\n",
       "      <td>15922590801</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>1</td>\n",
       "      <td>李庆</td>\n",
       "      <td>黄雨</td>\n",
       "      <td>13212370108</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>1</td>\n",
       "      <td>李庆</td>\n",
       "      <td>熊海燕</td>\n",
       "      <td>13635372037</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   大区 负责人 高级推广员           电话\n",
       "0   1  李庆   杨正伟  13752875696\n",
       "1   1  李庆    杨洋  18881930731\n",
       "2   1  李庆   柏欣艳  15922590801\n",
       "3   1  李庆    黄雨  13212370108\n",
       "4   1  李庆   熊海燕  13635372037"
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [],
   "source": [
    "data[\"temp\"] = '战队'\n",
    "data.loc[:,'战队'] =data['高级推广员'].str.cat(data[\"temp\"])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>大区</th>\n",
       "      <th>负责人</th>\n",
       "      <th>高级推广员</th>\n",
       "      <th>电话</th>\n",
       "      <th>temp</th>\n",
       "      <th>战队</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1</td>\n",
       "      <td>李庆</td>\n",
       "      <td>杨正伟</td>\n",
       "      <td>13752875696</td>\n",
       "      <td>战队</td>\n",
       "      <td>杨正伟战队</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>1</td>\n",
       "      <td>李庆</td>\n",
       "      <td>杨洋</td>\n",
       "      <td>18881930731</td>\n",
       "      <td>战队</td>\n",
       "      <td>杨洋战队</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>1</td>\n",
       "      <td>李庆</td>\n",
       "      <td>柏欣艳</td>\n",
       "      <td>15922590801</td>\n",
       "      <td>战队</td>\n",
       "      <td>柏欣艳战队</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>1</td>\n",
       "      <td>李庆</td>\n",
       "      <td>黄雨</td>\n",
       "      <td>13212370108</td>\n",
       "      <td>战队</td>\n",
       "      <td>黄雨战队</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>1</td>\n",
       "      <td>李庆</td>\n",
       "      <td>熊海燕</td>\n",
       "      <td>13635372037</td>\n",
       "      <td>战队</td>\n",
       "      <td>熊海燕战队</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   大区 负责人 高级推广员           电话 temp     战队\n",
       "0   1  李庆   杨正伟  13752875696   战队  杨正伟战队\n",
       "1   1  李庆    杨洋  18881930731   战队   杨洋战队\n",
       "2   1  李庆   柏欣艳  15922590801   战队  柏欣艳战队\n",
       "3   1  李庆    黄雨  13212370108   战队   黄雨战队\n",
       "4   1  李庆   熊海燕  13635372037   战队  熊海燕战队"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [],
   "source": [
    "data['密码']='a123456'"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>大区</th>\n",
       "      <th>负责人</th>\n",
       "      <th>高级推广员</th>\n",
       "      <th>电话</th>\n",
       "      <th>temp</th>\n",
       "      <th>战队</th>\n",
       "      <th>密码</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1</td>\n",
       "      <td>李庆</td>\n",
       "      <td>杨正伟</td>\n",
       "      <td>13752875696</td>\n",
       "      <td>战队</td>\n",
       "      <td>杨正伟战队</td>\n",
       "      <td>a123456</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>1</td>\n",
       "      <td>李庆</td>\n",
       "      <td>杨洋</td>\n",
       "      <td>18881930731</td>\n",
       "      <td>战队</td>\n",
       "      <td>杨洋战队</td>\n",
       "      <td>a123456</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>1</td>\n",
       "      <td>李庆</td>\n",
       "      <td>柏欣艳</td>\n",
       "      <td>15922590801</td>\n",
       "      <td>战队</td>\n",
       "      <td>柏欣艳战队</td>\n",
       "      <td>a123456</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>1</td>\n",
       "      <td>李庆</td>\n",
       "      <td>黄雨</td>\n",
       "      <td>13212370108</td>\n",
       "      <td>战队</td>\n",
       "      <td>黄雨战队</td>\n",
       "      <td>a123456</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>1</td>\n",
       "      <td>李庆</td>\n",
       "      <td>熊海燕</td>\n",
       "      <td>13635372037</td>\n",
       "      <td>战队</td>\n",
       "      <td>熊海燕战队</td>\n",
       "      <td>a123456</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   大区 负责人 高级推广员           电话 temp     战队       密码\n",
       "0   1  李庆   杨正伟  13752875696   战队  杨正伟战队  a123456\n",
       "1   1  李庆    杨洋  18881930731   战队   杨洋战队  a123456\n",
       "2   1  李庆   柏欣艳  15922590801   战队  柏欣艳战队  a123456\n",
       "3   1  李庆    黄雨  13212370108   战队   黄雨战队  a123456\n",
       "4   1  李庆   熊海燕  13635372037   战队  熊海燕战队  a123456"
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [],
   "source": [
    "data[\"temp\"] = '晟道'\n",
    "data['用户名'] = data['temp'].str.cat(data['高级推广员'])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>大区</th>\n",
       "      <th>负责人</th>\n",
       "      <th>高级推广员</th>\n",
       "      <th>电话</th>\n",
       "      <th>temp</th>\n",
       "      <th>战队</th>\n",
       "      <th>密码</th>\n",
       "      <th>用户名</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1</td>\n",
       "      <td>李庆</td>\n",
       "      <td>杨正伟</td>\n",
       "      <td>13752875696</td>\n",
       "      <td>晟道</td>\n",
       "      <td>杨正伟战队</td>\n",
       "      <td>a123456</td>\n",
       "      <td>晟道杨正伟</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>1</td>\n",
       "      <td>李庆</td>\n",
       "      <td>杨洋</td>\n",
       "      <td>18881930731</td>\n",
       "      <td>晟道</td>\n",
       "      <td>杨洋战队</td>\n",
       "      <td>a123456</td>\n",
       "      <td>晟道杨洋</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>1</td>\n",
       "      <td>李庆</td>\n",
       "      <td>柏欣艳</td>\n",
       "      <td>15922590801</td>\n",
       "      <td>晟道</td>\n",
       "      <td>柏欣艳战队</td>\n",
       "      <td>a123456</td>\n",
       "      <td>晟道柏欣艳</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>1</td>\n",
       "      <td>李庆</td>\n",
       "      <td>黄雨</td>\n",
       "      <td>13212370108</td>\n",
       "      <td>晟道</td>\n",
       "      <td>黄雨战队</td>\n",
       "      <td>a123456</td>\n",
       "      <td>晟道黄雨</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>1</td>\n",
       "      <td>李庆</td>\n",
       "      <td>熊海燕</td>\n",
       "      <td>13635372037</td>\n",
       "      <td>晟道</td>\n",
       "      <td>熊海燕战队</td>\n",
       "      <td>a123456</td>\n",
       "      <td>晟道熊海燕</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>78</th>\n",
       "      <td>4</td>\n",
       "      <td>钟文杰</td>\n",
       "      <td>王琳</td>\n",
       "      <td>15149338931</td>\n",
       "      <td>晟道</td>\n",
       "      <td>王琳战队</td>\n",
       "      <td>a123456</td>\n",
       "      <td>晟道王琳</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>79</th>\n",
       "      <td>4</td>\n",
       "      <td>钟文杰</td>\n",
       "      <td>王雨洋</td>\n",
       "      <td>15100986788</td>\n",
       "      <td>晟道</td>\n",
       "      <td>王雨洋战队</td>\n",
       "      <td>a123456</td>\n",
       "      <td>晟道王雨洋</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>80</th>\n",
       "      <td>4</td>\n",
       "      <td>钟文杰</td>\n",
       "      <td>马晓龙</td>\n",
       "      <td>13347106979</td>\n",
       "      <td>晟道</td>\n",
       "      <td>马晓龙战队</td>\n",
       "      <td>a123456</td>\n",
       "      <td>晟道马晓龙</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>81</th>\n",
       "      <td>4</td>\n",
       "      <td>钟文杰</td>\n",
       "      <td>巩鹏</td>\n",
       "      <td>13792181212</td>\n",
       "      <td>晟道</td>\n",
       "      <td>巩鹏战队</td>\n",
       "      <td>a123456</td>\n",
       "      <td>晟道巩鹏</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>82</th>\n",
       "      <td>4</td>\n",
       "      <td>钟文杰</td>\n",
       "      <td>荣珏梒</td>\n",
       "      <td>15831616120</td>\n",
       "      <td>晟道</td>\n",
       "      <td>荣珏梒战队</td>\n",
       "      <td>a123456</td>\n",
       "      <td>晟道荣珏梒</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>83 rows × 8 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "    大区  负责人 高级推广员           电话 temp     战队       密码    用户名\n",
       "0    1   李庆   杨正伟  13752875696   晟道  杨正伟战队  a123456  晟道杨正伟\n",
       "1    1   李庆    杨洋  18881930731   晟道   杨洋战队  a123456   晟道杨洋\n",
       "2    1   李庆   柏欣艳  15922590801   晟道  柏欣艳战队  a123456  晟道柏欣艳\n",
       "3    1   李庆    黄雨  13212370108   晟道   黄雨战队  a123456   晟道黄雨\n",
       "4    1   李庆   熊海燕  13635372037   晟道  熊海燕战队  a123456  晟道熊海燕\n",
       "..  ..  ...   ...          ...  ...    ...      ...    ...\n",
       "78   4  钟文杰    王琳  15149338931   晟道   王琳战队  a123456   晟道王琳\n",
       "79   4  钟文杰   王雨洋  15100986788   晟道  王雨洋战队  a123456  晟道王雨洋\n",
       "80   4  钟文杰   马晓龙  13347106979   晟道  马晓龙战队  a123456  晟道马晓龙\n",
       "81   4  钟文杰    巩鹏  13792181212   晟道   巩鹏战队  a123456   晟道巩鹏\n",
       "82   4  钟文杰   荣珏梒  15831616120   晟道  荣珏梒战队  a123456  晟道荣珏梒\n",
       "\n",
       "[83 rows x 8 columns]"
      ]
     },
     "execution_count": 12,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0     1\n",
       "1     1\n",
       "2     1\n",
       "3     1\n",
       "4     1\n",
       "     ..\n",
       "78    4\n",
       "79    4\n",
       "80    4\n",
       "81    4\n",
       "82    4\n",
       "Name: 大区, Length: 83, dtype: int64"
      ]
     },
     "execution_count": 14,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data.loc[:,'大区']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "def change_value(x):\n",
    "    if x['大区']==1:\n",
    "        return '一大区'\n",
    "    if x['大区']==2:\n",
    "        return '二大区'\n",
    "    if x['大区']==3:\n",
    "        return '三大区'\n",
    "    if x['大区']==4:\n",
    "        return '四大区'"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.2"
  },
  "toc": {
   "base_numbering": 1,
   "nav_menu": {},
   "number_sections": true,
   "sideBar": true,
   "skip_h1_title": false,
   "title_cell": "Table of Contents",
   "title_sidebar": "Contents",
   "toc_cell": false,
   "toc_position": {},
   "toc_section_display": true,
   "toc_window_display": false
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
